package cn.gym.service;

import cn.gym.dao.TrainerMapper;
import cn.gym.pojo.Trainer;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("trainerService")
public class TrainerServiceImpl implements TrainerService {
    @Resource
    private TrainerMapper trainerMapper;

    public TrainerMapper getTrainerMapper() {
        return trainerMapper;
    }

    public void setTrainerMapper(TrainerMapper trainerMapper) {
        this.trainerMapper = trainerMapper;
    }

    @Override
    public boolean register(Trainer trainer) {
        int isReg=0;
        boolean flag=false;
        try {
            isReg=trainerMapper.insert(trainer);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if(isReg>0){
            flag=true;
        }
        return flag;
    }
}
